package com.geekaca.testthread;

public class TestRunnable2 {
    public static void main(String[] args) {
        /**
         * Runnable 方式创建线程
         */
        MyRunnable myRunnable = new MyRunnable();
        new Thread(myRunnable).start();
    }
}

class MyRunnable implements Runnable{

    @Override
    public void run() {
        while (true){
            try {
                Thread.sleep(10000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(System.currentTimeMillis());
        }
    }
}
